package com.echronos.payment.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 接入商户类型
 *
 * @Author wangyadong
 * @Date 2024/02/21 15:29
 * @ClassName ChannelMerchantTypeEnums
 */
@Getter
@AllArgsConstructor
public enum ChannelMerchantTypeEnums {
    CPCN_PAY("CPCN_PAY", "中金支付"),
    CSC_HZPAY("CSC_HZPAY", "华正支付");

    private String channelCode;
    private String channelName;

    /**
     * 获取接口路由
     *
     * @param interfaceCode
     * @return
     */
    public static ChannelMerchantTypeEnums getByCode(String interfaceCode) {
        return Arrays.stream(ChannelMerchantTypeEnums.values()).filter(r -> r.getChannelCode().equals(interfaceCode))
                .findFirst().orElse(null);
    }
}
